package com.xcyy.zjdxmjk.zjdxmjk.service.Imp;

import com.xcyy.zjdxmjk.zjdxmjk.entity.Town;
import com.xcyy.zjdxmjk.zjdxmjk.repository.TownRepository;
import com.xcyy.zjdxmjk.zjdxmjk.service.TownService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TownServiceImp implements TownService {
    @Autowired
    private TownRepository townRepository;

    @Override
    public Town save(Town town) {
        return townRepository.save(town);
    }

    @Override
    public List<Town> findAll() {
        return townRepository.findAll();
    }

    @Override
    public Object countZjdAndJsyd() {
        return townRepository.countZjdAndJsyd();
    }

    @Override
    public Object countDcjggs() {
        return townRepository.countDcjggs();
    }

    @Override
    public List<Town> findByCodeStartsWith(String code) {
        return townRepository.findByCodeStartsWith(code);
    }

    @Override
    public List<Object> countDept() {
        return townRepository.countDept();
    }

    @Override
    public List<String> countDeptCode(String dept) {
        return townRepository.countDeptCode(dept);
    }

    @Override
    public Object countDcjggsGroupByCode(String code) {
        return townRepository.countDcjggsGroupByCode(code);
    }

    @Override
    public List<Town> findByDept(String dept) {
        return townRepository.findByDept(dept);
    }

    @Override
    public Town findByCode(String code) {
        return townRepository.findByCode(code);
    }

    @Override
    public List<Object> countZjdAndJsydGroupByCountry() {
        return townRepository.countZjdAndJsydGroupByCountry();
    }

    @Override
    public List<Object> countZjdAndJsydGroupByCity() {
        return townRepository.countZjdAndJsydGroupByCity();
    }

    @Override
    public List<Town> findByName(String name) {
        return townRepository.findByName(name);
    }
}
